<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>FinanceLib (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="FinanceLib (POI API Documentation)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FinanceLib.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/poi/ss/formula/functions/FinanceFunction.html" title="class in org.apache.poi.ss.formula.functions"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../../org/apache/poi/ss/formula/functions/Fixed.html" title="class in org.apache.poi.ss.formula.functions"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/poi/ss/formula/functions/FinanceLib.html" target="_top">FRAMES</a></li>
<li><a href="FinanceLib.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.ss.formula.functions</p>
<h2 title="Class FinanceLib" class="title">Class FinanceLib</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.poi.ss.formula.functions.FinanceLib</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public final class <strong>FinanceLib</strong>
extends java.lang.Object</pre>
<dl><dt><span class="strong">Author:</span></dt>
  <dd>Amol S. Deshmukh &lt; amolweb at ya hoo dot com &gt;


 This class is a functon library for common fiscal functions.
 <b>Glossary of terms/abbreviations:</b>
 <br/>
 <ul>
 <li><em>FV:</em> Future Value</li>
 <li><em>PV:</em> Present Value</li>
 <li><em>NPV:</em> Net Present Value</li>
 <li><em>PMT:</em> (Periodic) Payment</li>

 </ul>
 For more info on the terms/abbreviations please use the references below
 (hyperlinks are subject to change):
 </br>Online References:
 <ol>
 <li>GNU Emacs Calc 2.02 Manual: http://theory.uwinnipeg.ca/gnu/calc/calc_203.html</li>
 <li>Yahoo Financial Glossary: http://biz.yahoo.com/f/g/nn.html#y</li>
 <li>MS Excel function reference: http://office.microsoft.com/en-us/assistance/CH062528251033.aspx</li>
 </ol>
 <h3>Implementation Notes:</h3>
 Symbols used in the formulae that follow:<br/>
 <ul>
 <li>p: present value</li>
 <li>f: future value</li>
 <li>n: number of periods</li>
 <li>y: payment (in each period)</li>
 <li>r: rate</li>
 <li>^: the power operator (NOT the java bitwise XOR operator!)</li>
 </ul>
 [From MS Excel function reference] Following are some of the key formulas
 that are used in this implementation:
 <pre>
 p(1+r)^n + y(1+rt)((1+r)^n-1)/r + f=0   ...{when r!=0}
 ny + p + f=0                            ...{when r=0}
 </pre></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#fv(double, double, double, double, boolean)">fv</a></strong>(double&nbsp;r,
  double&nbsp;n,
  double&nbsp;y,
  double&nbsp;p,
  boolean&nbsp;t)</code>
<div class="block">Future value of an amount given the number of payments, rate, amount
 of individual payment, present value and boolean value indicating whether
 payments are due at the beginning of period
 (false => payments are due at end of period)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#nper(double, double, double, double, boolean)">nper</a></strong>(double&nbsp;r,
    double&nbsp;y,
    double&nbsp;p,
    double&nbsp;f,
    boolean&nbsp;t)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#npv(double, double[])">npv</a></strong>(double&nbsp;r,
   double[]&nbsp;cfs)</code>
<div class="block">calculates the Net Present Value of a principal amount
 given the discount rate and a sequence of cash flows
 (supplied as an array).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#pmt(double, double, double, double, boolean)">pmt</a></strong>(double&nbsp;r,
   double&nbsp;n,
   double&nbsp;p,
   double&nbsp;f,
   boolean&nbsp;t)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#pv(double, double, double, double, boolean)">pv</a></strong>(double&nbsp;r,
  double&nbsp;n,
  double&nbsp;y,
  double&nbsp;f,
  boolean&nbsp;t)</code>
<div class="block">Present value of an amount given the number of future payments, rate, amount
 of individual payment, future value and boolean value indicating whether
 payments are due at the beginning of period
 (false => payments are due at end of period)</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="fv(double, double, double, double, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fv</h4>
<pre>public static&nbsp;double&nbsp;fv(double&nbsp;r,
        double&nbsp;n,
        double&nbsp;y,
        double&nbsp;p,
        boolean&nbsp;t)</pre>
<div class="block">Future value of an amount given the number of payments, rate, amount
 of individual payment, present value and boolean value indicating whether
 payments are due at the beginning of period
 (false => payments are due at end of period)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - rate</dd><dd><code>n</code> - num of periods</dd><dd><code>y</code> - pmt per period</dd><dd><code>p</code> - future value</dd><dd><code>t</code> - type (true=pmt at end of period, false=pmt at begining of period)</dd></dl>
</li>
</ul>
<a name="pv(double, double, double, double, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pv</h4>
<pre>public static&nbsp;double&nbsp;pv(double&nbsp;r,
        double&nbsp;n,
        double&nbsp;y,
        double&nbsp;f,
        boolean&nbsp;t)</pre>
<div class="block">Present value of an amount given the number of future payments, rate, amount
 of individual payment, future value and boolean value indicating whether
 payments are due at the beginning of period
 (false => payments are due at end of period)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - </dd><dd><code>n</code> - </dd><dd><code>y</code> - </dd><dd><code>f</code> - </dd><dd><code>t</code> - </dd></dl>
</li>
</ul>
<a name="npv(double, double[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>npv</h4>
<pre>public static&nbsp;double&nbsp;npv(double&nbsp;r,
         double[]&nbsp;cfs)</pre>
<div class="block">calculates the Net Present Value of a principal amount
 given the discount rate and a sequence of cash flows
 (supplied as an array). If the amounts are income the value should
 be positive, else if they are payments and not income, the
 value should be negative.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - </dd><dd><code>cfs</code> - cashflow amounts</dd></dl>
</li>
</ul>
<a name="pmt(double, double, double, double, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pmt</h4>
<pre>public static&nbsp;double&nbsp;pmt(double&nbsp;r,
         double&nbsp;n,
         double&nbsp;p,
         double&nbsp;f,
         boolean&nbsp;t)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - </dd><dd><code>n</code> - </dd><dd><code>p</code> - </dd><dd><code>f</code> - </dd><dd><code>t</code> - </dd></dl>
</li>
</ul>
<a name="nper(double, double, double, double, boolean)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>nper</h4>
<pre>public static&nbsp;double&nbsp;nper(double&nbsp;r,
          double&nbsp;y,
          double&nbsp;p,
          double&nbsp;f,
          boolean&nbsp;t)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - </dd><dd><code>y</code> - </dd><dd><code>p</code> - </dd><dd><code>f</code> - </dd><dd><code>t</code> - </dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FinanceLib.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/poi/ss/formula/functions/FinanceFunction.html" title="class in org.apache.poi.ss.formula.functions"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../../org/apache/poi/ss/formula/functions/Fixed.html" title="class in org.apache.poi.ss.formula.functions"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/poi/ss/formula/functions/FinanceLib.html" target="_top">FRAMES</a></li>
<li><a href="FinanceLib.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
                <i>Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.</i>
            </small></p>
</body>
</html>
